<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html><html lang="en">
	<head>
		<!--加载header文件-->
		<?php
		include_once 'public/views/header.php';
		// include_once 'public/home/html/ueditor.php';
		include_once 'public/home/html/laydate.php';
		?>
		<?php
		include_once 'public/home/html/faltSelect.php';
		?>
		<link rel="stylesheet" href="public/css/edit.css" />
		<script src="public/js/cus_modal.js"></script>
		<style>
			body{
				overflow-x: hidden;
			}
			.required{
				min-width:80px;
			}
		</style>
	</head>
	<body>
		<div class="container">
			<div class="row">
				<input type="hidden" id="modal_title" value="<?=$title ?>" />
				<input type="hidden" id="modal_height" value="450" />
				<form id="editForm">
					<input type="hidden" id="id" name="id" value="<?=estr($detail, 'id') ?>" />
					<table class='edit_table'>
						<tr>
							<th class="required">标题</th>
							<td colspan="3">
								<input type="text" name="title" id="title" value="<?=estr($detail, 'title') ?>" dataType="*" />
							</td>
						</tr>
						<tr>
							<th class="required">次数</th>
							<td colspan="3">
								<input type="number" name="number" id="number" value="<?=estr($detail, 'number') ?>" dataType="*" />
							</td>
						</tr>
						
					</table>
				</form>
				<div class="viewContent">
					<!--这是显示具体车辆信息情况的。-->
				</div>
			</div>
		</div>
	</body>

	<script type="text/javascript">
	    $(".sumbit").on("click",function(){
	    	console.log($("form").serialize())
	    })
</script>

<script>

var d;
var demo;
$(function() {

	//开启验证
	demo = $("#editForm").Validform({
		tiptype: 3
	});
	addDialogButton("保存",save);
	
});

var save = function() {
	if(!demo.check()) {
		$('.Validform_error:first').focus();
		return;
	}

	d = dialog({
		title: '',
		content: "数据保存中,请稍后...",
	});
	d.showModal();

	var datas = getFormJson();

	$.ajax({
		url: "Admin/IndexLarge/classes_number_save",
		type: "post",
		data: datas,
		success: function(data) {
			if(d != undefined)
				d.close().remove();
			var ret = $.parseJSON(data);
			if(ret.status) {
				window.parent.topMessagePrompt('success',ret.msg);
					window.parent.refreshTable();
					hideDialogModal();
			} else {
				window.parent.topMessagePrompt('error',ret.msg);
			}
		}
	});
}	
</script>
</html>
